package com.ldc.common.state;

/**
 * 功能说明
 *
 * @auther liudc
 * @since 2023/6/17
 */
public enum StateCode {
    SUCCESS(200, "Success"),
    SUCCESSFULLY_LOGGED_OUT(201, "登出成功"),
    FAILED(400, "Failed"),
    UNKNOWN_ERROR(401, "未知错误"),
    ACCOUNT_NOT_LOGGED_IN(402, "账号未登录"),
    INSUFFICIENT_PERMISSIONS(403, "权限不足"),
    ACCOUNT_LOCKED(404, "账户被锁定"),
    PASSWORD_EXPIRATION(405, "密码过期"),
    ACCOUNT_EXPIRATION(406, "账户过期"),
    ACCOUNT_OR_PASSWORD_ERROR(407, "账号或密码错误"),
    USER_ALREADY_EXISTS(408, "用户已经存在"),
    TOKEN_NOT_FOUND(500, "Token 未发现"),
    TOKEN_UNAVAILABLE(501, "Token 不可用"),
    ;

    private final String msg;
    private final int code;

    private StateCode(int code, String msg) {
        this.msg = msg;
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public int getCode() {
        return code;
    }
}
